﻿@page "/login"
@layout LoginLayout
@inherits PageBase

<div class="main__b__0">
    <div class="login">
        <Form Model="@model" OnFinish="HandleSubmit">
            <Tabs DefaultActiveKey="account" OnChange="OnChange">
                <TabPane Key="account">
                    <Tab>账户密码登录</Tab>
                    <ChildContent>
                        <FormItem>
                            <AntDesign.Input Placeholder="Enter the username" Size="large" @bind-Value="@context.Username">
                                <Prefix><Icon Type="user" /></Prefix>
                            </AntDesign.Input>
                        </FormItem>
                        <FormItem>
                            <AntDesign.Input Placeholder="Enter the password" Size="large" @bind-Value="@context.Password" Type="password">
                                <Prefix><Icon Type="lock" /></Prefix>
                            </AntDesign.Input>
                        </FormItem>
                    </ChildContent>
                </TabPane>
                <TabPane Key="code">
                    <Tab>授权码登录</Tab>
                    <ChildContent>
                        <FormItem>
                            <Row Gutter="8">
                                <AntDesign.Col Span="14">
                                    <AntDesign.Input Placeholder="Enter the code" Size="large" @bind-Value="@context.Code">
                                        <Prefix><Icon Type="lock" /></Prefix>
                                    </AntDesign.Input>
                                </AntDesign.Col>
                                <AntDesign.Col Span="10">
                                    <Button Size="large" Loading="loading" Block OnClick="GetAuthCode">获取授权码</Button>
                                </AntDesign.Col>
                            </Row>
                        </FormItem>
                    </ChildContent>
                </TabPane>
            </Tabs>
            <Button Type="@ButtonType.Primary" HtmlType="submit" Class="submit" Size="large" Block>登&nbsp;录</Button>
            <div class="other">
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Alipay账号进行登录")">
                    <Icon OnClick="@( _ => HandleClick("alipay"))" Type="alipay-circle" Theme="fill" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Githu账号b进行登录")">
                    <Icon OnClick="@( _ => HandleClick("github"))" Type="github" Theme="fill" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Gitee账号进行登录")">
                    <Icon OnClick="@( _ => HandleClick("gitee"))" Component="giteeIcon" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Dingtalk账号进行登录")">
                    <Icon OnClick="@( _ => HandleClick("dingtalk"))" Type="dingtalk-circle" Theme="fill" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用QQ账号进行登录")">
                    <Icon OnClick="@( _ => HandleClick("qq"))" Type="qq-circle" Theme="fill" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Microsoft账号进行登录")">
                    <Icon OnClick="@( _ => HandleClick("microsoft"))" Type="appstore" Theme="fill" />
                </Tooltip>
                <Tooltip ArrowPointAtCenter="true" Title="@("使用Weibo进行登录")">
                    <Icon OnClick="@( _ => HandleClick("weibo"))" Type="weibo-circle" Theme="fill" />
                </Tooltip>
            </div>
        </Form>
    </div>
</div>
@code{
    RenderFragment giteeIcon =@<svg t='1611994252121' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1398' width='24' height='24'><path d='M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z' fill='#888888' p-id='1399'></path></svg>;
}